//链栈的初始化

#include<stdio.h>
#include<malloc.h>

typedef int SElemType;
typedef struct StackNode
{
	SElemType data;
	struct StackNode *next;
	
}StackNode,*LinkStack;

//初始化链栈
void InitStack(StackNode *&s)
{
	s = NULL;
	//空栈的栈顶指针为空
}


//判断栈是否为空
bool StackEmpty(StackNode *&s)
{
	if(s==NULL){
		return true;
		//TODO
	}
	else
		return false;
}


//链栈的入栈
void StackPush(StackNode *&s,SElemType e)
{
	StackNode*p = (StackNode*)malloc(sizeof(StackNode));
	p->data = e;
	p->next = s;
	s = p;
}

void StackPop(StackNode *&s,SElemType &e)
{
	if(s==NULL) return;
	StackNode *p = (StackNode*)malloc(sizeof(StackNode));
	e = s->data;
	p  = s;
	s = s->next;
	
	free(p);
	
}

int  main()
{
	
	
	return 0;
}
